<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link type="text/css" href="../css/system.css" rel="stylesheet"/>
<link type="text/css" href="../js/jDialog/jDialog.css" rel="stylesheet" >
<script type="text/javascript" src="../js/jDialog/jquery.dialog.js"></script>
<script type="text/javascript" src="../index.js"></script>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<title>管理员管理</title>
<script type="text/javascript">
$(document).ready(function() {
	var str = location.href;
	var num = str.indexOf("?");
	var userObj = null;
	var userId = str.substr(num+8,str.length);
	gUserId=userId;
	$.ajax({
		type : 'post',
		dataType : 'text',
		async: false,
		url : '../user/getUserInfoById.action',
		data : {
			"userDTO.userId":userId
		},
		success : function(msg) {
			if (msg != 0 && msg != null) {
				userObj = JSON.parse(msg);
				gUserPhoto = userObj[0].userPhoto;
				gUserNickName = userObj[0].userNickName;
				gUserPwd = userObj[0].userPwd;
				gUserSex = userObj[0].userSex;
			}	
		}
	});
	$("#headPhoto").attr("src",gUserPhoto); 
	document.getElementById("nickname").innerHTML=gUserNickName;
	$("#manaInfo")[0].contentWindow.userObj=userObj;
	$("#uPwd")[0].contentWindow.userObj=userObj;
	$("#uCheck")[0].contentWindow.userObj=userObj;
});
$.logout = function(){
	var dialog = jDialog.confirm('您确定要退出系统?',{
		handler : function(button,dialog) {
			$.ajax({
				type : 'post',
				dataType : 'text',
				async: false,
				url : '../user/logoutCheck.action',
				data : {
					"userDTO.userId":gUserId
				},
				success : function(msg) {
					window.location.href = "../user_login.html";
				},
				error : function(msg) {
					window.location.href = "../user_login.html";
				}
			});
			dialog.close();
		}
	},{
		handler : function(button,dialog) {
			dialog.close();
		}
	});
}
$.chanIframe = function(th){
	var idd = th.id;
	if(idd == 'menu1'){
		$("#uCheck").css('display', 'block');
		$("#manaInfo").css('display', 'none');
		$("#cCheck").css('display', 'none');
		$("#uPwd").css('display', 'none');
	}
	if(idd == 'menu2'){
		$("#uCheck").css('display', 'none');
		$("#manaInfo").css('display', 'none');
		$("#cCheck").css('display', 'block');
		$("#uPwd").css('display', 'none');
	}
	if(idd == 'menu3'){
		$("#uCheck").css('display', 'none');
		$("#manaInfo").css('display', 'none');
		$("#cCheck").css('display', 'none');
		$("#uPwd").css('display', 'block');
	}
	if(idd == 'headPhoto'){
		$("#uCheck").css('display', 'none');
		$("#manaInfo").css('display', 'block');
		$("#cCheck").css('display', 'none');
		$("#uPwd").css('display', 'none');
	}
}
</script>
</head>
<body>
<div style="position:relative;">
<div id="hidDiv">
<a onclick="$.logout()">退出登录</a>
</div>
<div id="topDiv">
<div class="logo"><img src="../images/earth-globe.png"/></div>
<div class="logo1">招聘网</div>
<div class="topLink">
<img id="headPhoto" onclick="$.chanIframe(this)" style="cursor:pointer;"/><span id="nickname"></span>
</div>
</div>
<div id="leftMenu">
<div class="clickDiv menuDiv" id="menu1" onclick="$.chanIframe(this)">用户审核</div>
<div class="clickDiv menuDiv" id="menu2" onclick="$.chanIframe(this)">企业审核</div>
<div class="clickDiv menuDiv" id="menu3" onclick="$.chanIframe(this)">修改密码</div>
</div>
<div id="rightPage">
 <iframe  src="managerInfo.html" name="manaInfo" id="manaInfo" width="100%" height="550px" > </iframe>
 <iframe style="display:none" src="checkUser.html" name="uCheck" id="uCheck" width="100%" height="550px" > </iframe>
 <iframe style="display:none" src="checkCompany.html" name="cCheck" id="cCheck" width="100%" height="550px" > </iframe>
 <iframe style="display:none" src="updateUser.html" name="uPwd" id="uPwd" width="100%" height="550px" > </iframe>
</div>
</div>
</body>
</html>